/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bionic.ce.commands.systemacc;

import com.bionic.ce.beans.Bankacc;
import com.bionic.ce.beans.User;
import com.bionic.ce.beans.Systemacc;
import com.bionic.ce.businesslogic.BankAccService;
import com.bionic.ce.commands.ICommand;
import com.bionic.ce.manager.Config;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author MAXIM
 */
public class CommandDepositGoToBankAccountInfo implements ICommand {

       @Override
    public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String page = null;
        Integer userId = ((User)request.getSession().getAttribute("user")).getUserid();
        String currency =((Systemacc)request.getSession().getAttribute("systemacc")).getCurrency();
        List<Bankacc> list=BankAccService.returnBankAccountsInfo(userId, currency);
        
        request.getSession().setAttribute("bankacclist", list);
        page = Config.getInstance().getProperty(Config.DEPOSITGOTOBANKACCAOUNTSINFO);

        return page;
    }
}